; cperl-mode.el: Don't misinterpret exec_fcn as keyword exec
authorHarald Jörg <haj@posteo.de>
Sun, 9 Mar 2025 15:26:51 +0000 (16:26 +0100)
committerHarald Jörg <haj@posteo.de>
Sun, 9 Mar 2025 15:26:51 +0000 (16:26 +0100)
* lisp/progmodes/cperl-mode.el
(cperl-after-block-and-statement-beg): Recognize _ as part of a
Perl symbol.  Fixes Bug#76851

* test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts
Two new test cases around the edges of Bug#76851

lisp/progmodes/cperl-mode.el
test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts

index 38015ed2acd13539a269ff2ba82c369980fb1b8f..dc37457f5304759befd31a5db414bf7e7d1bbc70 100644 (file)
@@ -5539,7 +5539,7 @@ CHARS is a string that contains good characters to have before us (however,
           (forward-sexp -1)
           (not
            (looking-at
-            "\\(map\\|grep\\|say\\|printf?\\|system\\|exec\\|tr\\|s\\)\\>")))))))
+            "\\(map\\|grep\\|say\\|printf?\\|system\\|exec\\|tr\\|s\\)\\_>")))))))
 
 \f
 (defun cperl-indent-exp ()
index ba35b1d06904612f5aa7198cfcfc43a21d3d40d7..ab00e9ce6d42f03649b219e32a14aa3b39f0a74e 100644 (file)
@@ -79,3 +79,22 @@ class C
 
 say "done!";
 =-=-=
+
+Name: cperl-keyword-in-subname
+
+=-=
+# Bug#76851
+sub exec_fcn {
+}
+
+sub other {
+}
+=-=-=
+
+Name: cperl-keyword-without-space
+
+=-=
+# Bug#76851, message #13
+my %h = map{$_=>1}
+  @ARGV;
+=-=-=